#include <iostream>
using namespace std;
#define int long long
const int N = 55;
int a1, b1;
int a2, b2;
int a[N][N];
int dx[8] = {-1, -2, -2, -1, 1, 2, 2 ,1};
int dy[8] = {-2, -1, 1, 2, 2, 1, -1, -2};
signed main() {
    cin >> a1 >> b1 >> a2 >> b2;
    a1++, b1++, a2++, b2++;
    int n = max(a1, a2);
    int m = max(b1, b2);
    a[a2][b2] = -1;
    for(int i = 0; i < 8; i++) {
        int x = a2 + dx[i];
        int y = b2 + dy[i];
        if(x >= 1 && x <= 50 && y >= 1 && y <= 50) {
            a[x][y] = -1;
        }
    }
    a[1][1] = 1;
    for(int i = 1; i <= 50; i++) {
        for(int j = 1; j <= 50; j++) {
            if(i == 1 && j == 1) continue;
            if(a[i][j] == -1) {
                a[i][j] = 0;
                continue;
            }
            a[i][j] = a[i - 1][j] + a[i][j - 1];
        }
    }
    
    cout << a[a1][b1] << endl;
    return 0;
}